<?php 

    function msssqlselectdata($data,$table,$condition)
	{

		$sql = '';
			if($condition != "")
			{
				$sql = "SELECT"." ".$data." "."FROM"." ".$table." "."WHERE"." ".$condition ;
			}else{
				$sql = "SELECT"." ".$data." "."FROM"." ".$table ;
			}	
		//echo $sql;
		return mssql_query($sql);
	}

	 function MssqlInsert($table,$field,$input)
	{
			 
			 	$sql = "INSERT INTO"." "."$table"." ". 
							 "("."$field".")".
							 " "."VALUES"." "."("."$input".")";
			 	
				 
		echo $sql;
		return mssql_query($sql);;
	}
	
	
	function UpDateMssql($table,$data,$pointsql)
	{
				
				$sql = "UPDATE"." "."$table"." "."SET".
				" "."$data"." ".
				"WHERE"." "."$pointsql";
				
				//echo $sql;
				
		
		return mssql_query($sql);
	}

	function mssqlfetcharray($datafetch)
	{
		return @mssql_fetch_array($datafetch);  
	}
	
	function read_dir($dir, $array = array()){ 
			$dh = opendir($dir); 
			$files = array(); 
			while(($file = readdir($dh)) !== false) { 
			   $flag = false; 
			   if($file !== '.' && $file !== '..' && !in_array($file, $array)) { 
				  $files[] = $file; 
				} 
			} 
			return $files;
	
	}



?>